package TeatCase;

/**
 * Created by zhe.xiao on 2017/7/19.
 */

import android.support.test.uiautomator.UiObject2;
import android.util.Log;
import org.junit.Test;
import QunarTest.QuanrTestCase;
import static HomeElements.AssertElementsContent.*;
import org.junit.Assert;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import util.UIHelper;

@RunWith(JUnit4.class)
public class TestBanner extends QuanrTestCase {
    String text = TestBanner.class.getSimpleName();
    @Test
    public void testBanner() {
        int num = UIHelper.getHomeElements().getBannerNum();
        Log.i("UIAUTOMATOR", "BANNER " + num);
        for (int i = 0; i < num; i++) {
            UiObject2 b = UIHelper.getHomeElements().getBanner();
            b.click();
            Log.i("UIAUTOMATOR", "BANNER_1 " + i);
            UIHelper.getElementsAction().sleep(2000);
            UIHelper.getElementsAction().assertFalse(bannerInternetDes(),text + "_banner_" + i);
            UIHelper.getElementsAction().back();
            if (i < num - 1) {
                UIHelper.getElementsAction().swipForScrollableRight(b.getParent().getParent());
                Log.i("UIAUTOMATOR", "BANNER_xz ");
            }
        }
    }

    @Test
    public void testBna(){
        
    }
}
